home *** CD-ROM | disk | FTP | other *** search
- Path: blue.cse.ogi.edu!leneis
- From: leneis@blue.cse.ogi.edu (Tony Leneis)
- Newsgroups: comp.sys.amiga.misc
- Subject: Re: AmigaOS 4.x features
- Date: 12 Apr 1996 23:43:55 GMT
- Organization: Oregon Graduate Institute (OGI), Portland, Oregon
- Message-ID: <4kmprr$2gb@reuter.cse.ogi.edu>
- References: <4j7ein$a6v@B1FF.mindspring.com> <4jkg5j$dva@B1FF.mindspring.com> <4jl6pr$knv@reuter.cse.ogi.edu> <4kkf60$268e@mule1.mindspring.com>
- NNTP-Posting-Host: blue.cse.ogi.edu
-
- Charlie Moody <chmood@photobooks.atdc.gatech.edu> wrote:
- >On 31 Mar 1996 05:56:11 GMT, Tony Leneis wrote:
- >: test#a <- Matches 'test', 'testa', 'testaa', 'testaaa', etc.
- >
- > test*a <- Matches 'test', 'testa', 'testaa', 'testaaa', etc.
-
- test*a also matches 'testba', 'testbadfilea', 'test1234a', etc. while
- test#a only matches test followed by zero or more a's. It's not the
- same thing.
-
- >: test#(ab)c <- Matches 'testc', 'testabc', 'testababc', 'testabababc', etc.
- >
- >Ya got me on this one...but do you (does anyone) *really* use such
- >screwball naming conventions?
-
- Not often, but it can be handy from time to time, especially when you're
- dealing with a slew of data files that follow some sort of a regular
- naming scheme. A more common one for me would be something like 'data#[0-9]',
- which selects any file named data followed by zero or more digits.
-
- >: On the other hand, there are no UNIX globbing patterns which cannot be
- >: expressed as an Amiga pattern. Hence, Amiga patterns are more powerful.
- >
- >It's afloor wax! It's a breath mint! It's BOTH!!! As I said...
-
- I wasn't trying to sell it - I was simply trying to point out that the Amiga
- patterns are more powerful than UNIX globbing patterns. I don't have your
- original post anymore, but as I recall you were complaining that the Amiga
- pattern matching was not as powerful as what is provided by UNIX shells, which
- just is not true.
-
- >Please understand: it's not my intention to insult my own machine
- >(currently a much-upgraded 2000, replacing my grey-bearded 1000, which is
- >now sunning itself in the back 40); my comments were directed at making
- >the *CLI* more flexible/convenient. File globbing or not, I have always
- >found the standard Amiga pattern-matching to be less simple, less
- >intuitive, and hence less useful when moving bunches of files around
- >(which I do...a lot....).
-
- Point taken. If that had been all your original post had said, I probably
- would have left it alone. I just had a problem with the 'not as powerful
- as' and 'poorly designed' bits of the post. The Amiga pattern matching
- syntax is different from UNIX's file globbing, but then again it's also
- different from VMS's and MS-DOS's... It is not less powerful.
-
- >: Would you have preferred the standard UNIX regular expression
- >: syntax? Then you'd have to type '.*' instead of '#?', and you'd have to
- >: remember to escape the '.' whenever you didn't want it to act as the Amiga
- >: '?' metacharacter. (Kind of a bummer if you're looking for '#?.c', or should
- >: I say '.*\.c' as a UNIX regular expression.)
- >
- >??? I've never encountered such a thing as you seem to be describing,
- >from System III thru the current (Vr4?). Certainly I've never had to
- >jump thru *these* hoops on a unix box.
-
- Note that I was talking about regular expressions there. I don't know of any
- UNIX shell that provides regular expressions for file expansion purposes, but
- it's what many of the utilities use: awk; egrep and grep; ed, ex, sed, and vi;
- and csplit to name a few. This means that you have to learn two types of
- pattern matching for UNIX. The nice thing about the Amiga's pattern matching
- is that it's sufficiently general to be used anywhere that regular expressions
- would be useful, and it doesn't suffer from UNIX regular expression's
- unfortunate choice of metacharacters. (Unfortunate when working with common
- filename pattern matching, anyway.)
-
- >Or, to quote some old fart: "It's not that the bear sings well: it's
- >that the bear sings at all." Or another: "Use the right tool for the job."
-
- Exactly. In my experience, I've found myself wishing that UNIX shells provide
- the same functionality as the Amiga's pattern matching. Actually, when you
- get down to it, I think the pattern matching provided by WB 3.0 and above
- pretty much does what you want, except that you have to use a utility to turn
- on the map-*-as-#? function. All the other metacharacters work the same,
- except that you have to use '~' instead of '^' to compliment sets.
- Incidentally, another bonus of 3.1 over 2.04 is all the ADOS commands accept
- multiple filenames. 2.04 used to drive me nuts when I wanted to delete 3 or
- 4 files that were not practical to generate patterns for.
-
- >: Just out of curiosity, whose wheel should they have
- >: used instead of inventing their own? As far as I know, there was no RFC or
- >: other standard for file wildcarding when AmigaDOS was developed. Which UNIX
- >: shell should they have followed?
- >
- >This is just a *bit* disingenuous, doncha think? Do you believe standards
- >grow on RFC's? Taking what works and improving it is a time-honored way
- >of making progress.
-
- Not really. You complained that the Amiga's pattern matching was different
- from everybody else's. I was just wondering whose scheme they should have
- followed. Heck, no two UNIX shells agree on filename expansion, other than
- '*', '?', and perhaps the '[]' pair (some shells don't know what to do with
- '[^A-Z]'.)
-
- >Much more useful FOR WHAT? I say it's not more useful, in my experience,
- >for moving masses of files around from the command line, because in my
- >experience it's *not* more useful. It may be just the thing for
- >complementing complex scripted functions, but I don't care, really. If I
- >wanted to do enough studying to master that art, I'd tackle perl, or Python.
-
- And my experiences have been just the opposite. Then again, at work I have
- to deal with tens of thousands of files that follow regular naming
- conventions (e.g. an embedded date or sequence number). There have been
- many situations where I've really wanted ADOS's pattern matching power.
- Fortunately, I was able to port GNU find to the UNIX boxes I work on, so
- I'm able to do regular expression matching; however, typing things like
-
- find . -regex '\./eft[0-9]*\.dat' -maxdepth 1 -exec rm {} \;
-
- under UNIX is not as convenient as typing
-
- delete eft#[0-9].dat
-
- on the Amiga. To be fair, find is an incredibly powerful command that can
- do all sorts of cool things; however, I have to use it or write some custom
- script that uses sed or grep or something in order to get regexp capable
- pattern matching. The shells I have available (sh, ksh, and bash) can't
- hack it.
-
- >Granted, I was working on unix boxes long before I got my 1000, and I'm
- >*used* to doing certain things w/ the cli; for me, it seems that the
- >unix command line was designed as a primary interface, and the Amiga cli
- >does not improve on it, and doesn't even equal it, in ease of common
- >use. I've managed to avoid MooseDOS for most of my career, and I'm very
- >pleased about that; and I don't *want* to run Linux or whatever: I
- >*like* my machine!
-
- I'm just the opposite - I didn't start using UNIX with any frequency until
- 1987, so I'd already learned the Amiga's pattern matching. I agree that
- the Amiga CLI could use a makeover; however, I don't see anything really
- wrong with the pattern matching.
-
- >*sigh* This wasn't meant to be a fight; and as you say, the
- >functionality I asked for is substantially available to me now on my
- >Amiga, so this really is a moot point.
-
- Agreed. Really, the only thing I was attempting to point out was that
- the Amiga pattern matching is not less powerful than what UNIX shells
- provide, and that there is nothing wrong with the design. It *is*
- different, and the learning curve is steeper (because there are more
- meta characters to learn), but that's it. It's certainly not underpowered
- or a kludge. Personally, I feel that the manuals could use a little work
- on explaining how Amiga pattern matching works, but I don't think it should
- be scrapped. If you think it should be redone because you don't care for
- the syntax and semantics, that's fine. I only objected to the incorrect
- statement that AmigaDOS pattern matching was less powerful than UNIX shell
- pattern matching being presented as fact.
-
- -Tony
- --
- =====///===Hi!==I'm=a=.signature=virus!==Copy=me=to=your=.signature!===///==
- __ /// leneis@cse.ogi.edu From the desk of: Hillary, __ ///
- \\\/// tony@plaza.ds.adp.com -->Tony Leneis<-- Gennifer, \\\///Only
- \XX/ aleneis@gauss.math.hmc.edu HMC '91 Go Stags! AND NOW US!\XX/Amiga
-